unit CodigoBarras;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Mask, Buttons;

type
  TFormCOdigoBarras = class(TForm)
    Label1: TLabel;
    MaskEdit1: TMaskEdit;
    BitBtn1: TBitBtn;
    procedure BitBtn1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormCOdigoBarras: TFormCOdigoBarras;

implementation

uses principal;

{$R *.dfm}

procedure TFormCOdigoBarras.BitBtn1Click(Sender: TObject);
begin
        FOrmPrincipal.CodigoBarras:=MaskEdit1.Text;
end;

procedure TFormCOdigoBarras.FormShow(Sender: TObject);
begin
        if FormCOdigoBarras.Caption='Código de Barras - CODABAR' then
        begin
                MaskEdit1.Text:='3111701320637'
        end
        else if FormCOdigoBarras.Caption='Código de Barras - CODE 39' then
        begin
                MaskEdit1.Text:='*GSJ-220097*'
        end
        else if FormCOdigoBarras.Caption='Código de Barras - EAN 13' then
        begin
                MaskEdit1.Text:='789000000001'
        end
        else if FormCOdigoBarras.Caption='Código de Barras - EAN 8' then
        begin
                MaskEdit1.Text:='7890001'
        end
        else if FormCOdigoBarras.Caption='Código de Barras - ITF (Intercalado 2x5)' then
        begin
                MaskEdit1.Text:='0123456789012345'
        end
        else if FormCOdigoBarras.Caption='Código de Barras - UPC A' then
        begin
                MaskEdit1.Text:='01234567890'
        end
        else if FormCOdigoBarras.Caption='Código de Barras - UPC E' then
        begin
                MaskEdit1.Text:='01234567890'
        end



end;

end.
